<div id="view-content">    
    <h1>Modifications [Project: <?= $this->project['name'] ?>]</h1>
    <div class="row-fluid">
        <table class="table well table-condensed">
            <thead>
                <tr>
                    <th class="span1">#</th>
                    <th class="span6">Title</th>
                    <th class="span2">Added By</th>
                    <th class="span2">Status</th>
                    <th class="span2">Operations</th>
                </tr>
            </thead>
            <tbody>
                <?php
                $index = 1;
                foreach ($this->fetchAll as $modification) {
                    ?>
                    <tr class="<?=$modification['class']?>">
                        <td><?= $index ?></td>
                        <td><?= $modification['details']['main']->title ?></td>
                        <td>
                            <?php
                            if ($modification['details']['main']->addedByAdmin) {
                                echo "Admin";
                            } else {
                                echo "Client";
                            }
                            ?>
                        </td>
                        <td><?= $modification['status'] ?></td>
                        <td>
                            <a class="btn btn-small" href="<?= $this->url(array('id' => $this->projectId, 'modificationId' => $modification['id']), 'modification-view'); ?>"><i class="icon-info-sign"></i></a>
                            <?php
                            if($this->isAdmin){ ?>
                                <a class="btn btn-small" href="<?= $this->url(array('id' => $this->projectId, 'modificationId' => $modification['id']), 'modification-status'); ?>"><i class="icon-edit"></i></a>
                           <?php }
                            ?>
                        </td>
                    </tr>
                    <?php
                    $index++;
                }
                ?>
            </tbody>
        </table>
        <?php if ($this->project['finalized']) { ?>
            <a class="btn btn-success btn-small" href="<?= $this->url(array('id' => $this->projectId), 'modification-add'); ?>"><i class="icon-white icon-plus-sign"></i> Add New Modification</a> 
        <?php }
        ?>        
        <a class="btn btn-small btn-info" href="<?= $this->url(array(), 'project'); ?>"><i class="icon-white icon-circle-arrow-left"></i> Project</a>
    </div>   
</div>